//
//  UPBackgroundViewController.m
//  Uang Pasti
//
//  Created by 李永彬 on 2025/8/15.
//

#import "UPBackgroundViewController.h"

@interface UPBackgroundViewController ()

@end

@implementation UPBackgroundViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.hiddenTabBar = YES;
    self.view.backgroundColor = [UIColor whiteColor];
    _bgImageView = [[UIImageView alloc] init];
    _bgImageView.contentMode = UIViewContentModeScaleToFill;
    _bgImageView.clipsToBounds = YES;
    _bgImageView.userInteractionEnabled = YES;
    _bgImageView.image = [UIImage imageNamed:@"go_to_apply_bg"];
    [self.view addSubview:_bgImageView];
    [_bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self hiddenCustomTabBar:_hiddenTabBar];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    [self hiddenCustomTabBar:_hiddenTabBar];
}

-(void)hiddenCustomTabBar: (BOOL)hidden {
    UIWindow *window = [UIApplication up_currentKeyWindow];
    if ([window.rootViewController isKindOfClass:[UPTabBarViewController class]]) {
        UPTabBarViewController *tabBarVC = (UPTabBarViewController *)window.rootViewController;
        [tabBarVC setCustomTabBarHidden:hidden];
    }
}


@end
